<%@page import="com.sfd.entity.Borrow_List"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

		<link rel="stylesheet" type="text/css" href="../../skin/css/base.css">
			<script type="text/javascript" src="../../js/jquery.js">
</script>
			<script type="text/javascript" src="../../js/thickbox_plus.js">
</script>
			<script src="../../js/dt.js">
</script>
			<link rel="stylesheet" type="text/css" href="../../css/thickbox.css" />
<style type="text/css">
	a{
		text-decoration:none;
	}

</style>
<script language="javascript">
function viewArc(aid) {
	if (aid == 0)
		aid = getOneItem();
	window.open("archives.asp?aid=" + aid + "&action=viewArchives");
}
function editArc(aid) {
	if (aid == 0)
		aid = getOneItem();
	location = "archives.asp?aid=" + aid + "&action=editArchives";
}
function updateArc(aid) {
	location.reload();
}
function checkArc(aid) {
	var qstr = getCheckboxItem();
	if (aid == 0)
		aid = getOneItem();
	location = "archives.asp?aid=" + aid + "&action=checkArchives&qstr=" + qstr
			+ "";
}
function moveArc(aid) {
	var qstr = getCheckboxItem();
	if (aid == 0)
		aid = getOneItem();
	location = "archives.asp?aid=" + aid + "&action=moveArchives&qstr=" + qstr
			+ "";
}
function adArc(aid) {
	var qstr = getCheckboxItem();
	if (aid == 0)
		aid = getOneItem();
	location = "archives.asp?aid=" + aid + "&action=commendArchives&qstr="
			+ qstr + "";
}
function delArc(aid) {
	var qstr = getCheckboxItem();
	if (aid == 0)
		aid = getOneItem();
	location = "archives.asp?aid=" + aid + "&action=delArchives&qstr=" + qstr
			+ "";
}

//获得选中文件的文件名
function getCheckboxItem() {
	var allSel = "";
	if (document.form2.id.value)
		return document.form2.id.value;
	for (i = 0; i < document.form2.id.length; i++) {
		if (document.form2.id[i].checked) {
			if (allSel == "")
				allSel = document.form2.id[i].value;
			else
				allSel = allSel + "`" + document.form2.id[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem() {
	var allSel = "";
	if (document.form2.id.value)
		return document.form2.id.value;
	for (i = 0; i < document.form2.id.length; i++) {
		if (document.form2.id[i].checked) {
			allSel = document.form2.id[i].value;
			break;
		}
	}
	return allSel;
}
function selAll() {
	for (i = 0; i < document.form2.id.length; i++) {
		if (!document.form2.id[i].checked) {
			document.form2.id[i].checked = true;
		}
	}
}
function isone() {
	var count = 0;
	for (i = 0; i < document.form2.id.length; i++) {
		if (document.form2.id[i].checked) {
			count++;

		}
	}
	if (count < 1) {
		alert("没有选择数据！");
		return;
	}

	if (count > 1) {
		alert("只可选择一条信息");
		return;
	} else {
		location = "roleset.html?height=400;width=300";
	}
}
function noone() {
	var count = 0;
	for (i = 0; i < document.form2.id.length; i++) {
		if (document.form2.id[i].checked) {
			count++;
		}
	}
	if (count == 0) {
		alert("您没有选择删除目标！");
		return;
	} else {
		alert("您已成功删除目标！");
		location.reload();

	}
}
function noSelAll() {
	for (i = 0; i < document.form2.id.length; i++) {
		if (document.form2.id[i].checked) {
			document.form2.id[i].checked = false;
		}
	}
}
function returnbooks() {
	alert(11);
	document.getElementById("actioncode").value = "returnbooks"

	document.form2.submit();

}
</script>
			<style type="text/css">
.t1 {
	text-align: center;
}
</style>
	</head>
	<body bgcolor="#009edb" leftmargin="0"
		background='../../skin/images/allbg.gif'>

		<!--  快速转换位置按钮  -->
		<!--  内容列表   -->
		<form name="form2" action="/librarysystem/studentServlet"
			method="post">

			<table width="100%" border="0" cellpadding="2" bgcolor="#D1DDAA"
				cellspacing="1" align="center" style="margin-top: 8px">
				<tr align="center" bgcolor="#E7E7E7">
					<td height="24" colspan="10"
						background="../参考原型-2/skin/images/tbg.gif">
						&nbsp;借阅信息列表&nbsp;
					</td>
				</tr>
				<tr align="center" bordercolor="#99FF00" bgcolor="#FAFAF1"
					height="22">
					<td align="center" width="10%" height="47">
						<span class="t1">选择</span>
					</td>
					<td align="center" width="10%" height="47">
						<span class="t1">借阅记录</span>
					</td>
					<td align="center" width="10%">
						<span class="t1">学生学号</span>
					</td>
					<td align="center" width="10%">
						借阅书号
					</td>
					<td align="center" width="10%">
						借阅开始时间
					</td>
					<td align="center" width="10%">
						借阅结束时间
					</td>
					<td align="center" width="10%">
						归还情况
					</td>

				</tr>
				<%
					List borrow_lists = (List) request.getAttribute("borrow_lists");
					for (int i = 0; i < borrow_lists.size(); i++) {

						Borrow_List borrow_list = (Borrow_List) borrow_lists.get(i);
				%>
				<tr bgcolor="#FAFAF1"
					onMouseMove="javascript:this.bgColor='#149ff8';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';"
				>
					<td align="center">
						<input type="checkbox" id="id" class="np" name=borrowNO
							value=<%=borrow_list.getBorrowNo()%> />
					</td>
					<td align="center"><%=borrow_list.getBorrowNo()%></td>
					<td align="center"><%=borrow_list.getStudentId()%></td>
					<td align="center"><%=borrow_list.getBookId()%></td>
					<td align="center"><%=borrow_list.getStartTime()%></td>
					<%
						if (borrow_list.getEnd() == null) {
					%>
					<td align="center">
						未还
					</td>
					<%
						} else {
					%>
					<td align="center"><%=borrow_list.getEnd()%></td>
					<%
						}
							if (borrow_list.getDeal() == 1) {
					%>
					<td align="center">
						已还
					</td>
					<%
						} else if (borrow_list.getDeal() == 0) {
					%>
					<td align="center">
						未还
					</td>
					<%
						}
					%>
				</tr>
				<%
					}
				%>



				<tr bgcolor="#FAFAF1">
					<td height="28" colspan="8" align="center">
						<br />
						<span class="t1">&nbsp; <a href="javascript:selAll()"
							class="coolbg">全选</a> <a href="javascript:noSelAll()"
							class="coolbg">取消</a> <a href="javascript:updateArc()"
							class="coolbg">&nbsp;更新&nbsp;</a> <a
							href="javascript:updateArc(0)" class="coolbg">&nbsp;上一页&nbsp;</a>
							<a href="javascript:updateArc(0)" class="coolbg">&nbsp;下一页&nbsp;</a>
							<a href="javascript:returnbooks()" class="coolbg">&nbsp;归还&nbsp;</a>
							<!-- <a href="javascript:noone()" class="coolbg">&nbsp;删除&nbsp;</a>  </span></td> -->
				</tr>




			</table>
			<input type="hidden" name=actioncode id=actioncode value="" />
		</form>

	</body>
</html>
